home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Xconq 7.1.0 / src / xconq-7.1.0 / test / src-uses.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1996-07-07  |  784 b   |  24 lines  |  [TEXT/R*ch]

  1. #!/bin/sh
  2.  
  3. # This script counts the references to GDL symbols in all Xconq sources.
  4.  
  5. cd $1/..
  6.  
  7. # Count uses of keywords.
  8.  
  9. for file in keyword.def action.def history.def plan.def task.def goal.def ; do
  10.     for sym in `grep '^DEF_' kernel/$file | sed -e 's/^[^,]*, \([a-zA-Z0-9_]*\)[,)].*$/\1/' | grep -v '^zz-'` ; do
  11.         rslt=`grep -c "${sym}[^A-Za-z_]" */*.[hc] | grep -v ':0$' | sed -e 's/:1$//' | tr '\012' ' '`
  12.         echo ${sym} '    ' ${rslt}
  13.     done
  14. done
  15.  
  16. # Count uses of function-based symbols.
  17.  
  18. for file in utype.def mtype.def ttype.def table.def gvar.def ; do
  19.     for fun in `grep '^DEF_' kernel/${file} | sed -e 's/^[^,]*, \([a-zA-Z0-9_]*\),.*$/\1/' | grep -v '^zz-'` ; do
  20.         rslt=`grep -c $fun */*.[hc] | grep -v ':0$' | sed -e 's/:1$//' | tr '\012' ' '`
  21.         echo ${fun} '    ' ${rslt}
  22.     done
  23. done
  24.